package com.atan.xiaohongshu.auth.controller.verificationcode;


import com.atan.framework.biz.operationlog.aspect.ApiOperationLog;
import com.atan.framework.common.response.Response;
import com.atan.xiaohongshu.auth.model.vo.verificationcode.SendVerificationCodeReqVO;
import com.atan.xiaohongshu.auth.service.impl.VerificationCodeServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 获取验证码--控制层
 */
@RestController
@RequestMapping("/verification/code/")
public class VerfificationCodeController {

    @Autowired
    private VerificationCodeServiceImpl verificationCodeService;

    @PostMapping("/send")
    @ApiOperationLog(description = "发送验证码")
    public Response sendVerificationCode(@RequestBody @Validated SendVerificationCodeReqVO sendVerificationCodeReqVO) throws Exception {
        verificationCodeService.sendVerificationCode(sendVerificationCodeReqVO);
        return Response.success();
    }
}
